<?php

namespace App\Models;

use App\Traits\Model as ModelTrait;
use Encore\Admin\Traits\ModelTree;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CommonRegion extends Model
{

    use ModelTree {
        ModelTree::boot as treeBoot;
    }
    use HasFactory;
    use ModelTrait;

    protected $table="common_region";

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        #$this->setOrderColumn('id');
        $this->setTitleColumn('name');

    }

    public static function Area(){
        return new static();
    }

    public function getNameAttribute($value){
        return $value?:'-';
    }

}
